package com.fyales.android.juhejoke.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.fyales.android.juhejoke.R;

import java.util.List;

public class DemoActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo);

        String[] values = new String[]{
                "加载图片示例",
                "Map()变换示例",
                "MapFlat()变换示例"
        };

        ListView lv = (ListView) findViewById(R.id.demo_lv);
        ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1,values);
        lv.setAdapter(adapter);
        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                switch (position){
                    case 0:
                        startActivity(new Intent(DemoActivity.this,LoadImageInSameThreadActivity.class));
                        break;
                    case 1:
                        startActivity(new Intent(DemoActivity.this,MapFunctionDemoActivity.class));
                        break;
                    case 2:
                        startActivity(new Intent(DemoActivity.this,MapFlatFunctionDemoActivity.class));
                }
            }
        });

    }
}
